package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.ApplicationDto;
import xyz.zhouzhaodong.crm.service.IApplicationService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 申请表（学校和专业） 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-06-18
 */
@RestController
@RequestMapping("/application")
public class ApplicationController {

    @Resource
    IApplicationService applicationService;

    /**
     * 新增申请
     * @param applicationDto
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addApplication(ApplicationDto applicationDto){
        return applicationService.addApplication(applicationDto);
    }

    /**
     * 删除申请
     * @param applicationDto
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteApplication(ApplicationDto applicationDto){
        return applicationService.deleteApplication(applicationDto);
    }

    /**
     * 更新申请
     * @param applicationDto
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateApplication(ApplicationDto applicationDto){
        return applicationService.updateApplication(applicationDto);
    }

    /**
     * 查询申请
     * @param applicationDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectApplication(ApplicationDto applicationDto){
        return applicationService.selectApplication(applicationDto);
    }

    /**
     * 查询申请列表
     * @param applicationDto
     * @return
     */
    @RequestMapping("/selectList")
    public RestMessage selectApplicationList(ApplicationDto applicationDto){
        return applicationService.selectApplicationList(applicationDto);
    }


}
